package com.sx.zongzhi.presenter;

import com.sx.zongzhi.MyApplication;
import com.sx.zongzhi.bean.DisputeDetailBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.IDisputeDetailView;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by XZY on 2017/12/1.
 *获取矛盾纠纷详情
 */
public class DisputeDetailPest {

    private IDisputeDetailView detailView;

    public DisputeDetailPest(IDisputeDetailView detailView) {
        this.detailView=detailView;
    }


    /**
     * 获取矛盾纠纷处理过程
     * @param id 事件主键
     * @param issueStepId 事件步骤主键
     * @param stepStatusCode 步骤状态编号
     */
    public void getDisputeDetail(String id, String issueStepId, int stepStatusCode){
        Map<String,Object> map=new HashMap<>();
        map.put("sid", MyApplication.sid);
        map.put("id",id);
        map.put("issueStepId",issueStepId);
        map.put("stepStatusCode",stepStatusCode);
        new ApiManager().getDisputeDetail(map, new BaseCallBack<BaseResult<DisputeDetailBean>>() {
            @Override
            public void onSuccess(BaseResult<DisputeDetailBean> response) {
                detailView.getDisputeDetail(response.getData());
            }
            @Override
            public void onFailures(String message) {
                detailView.showError(message);
            }
        });
    }

}
